Skip to content

Fix/preserve additional formatting options - #1929

Merged
Dirk Bäumer (dbaeumer) merged 8 commits into
microsoft:mainfrom
JohannesStoehr:fix/preserve-additional-formatting-options
Nov 4, 2026
Merged

Dirk Bäumer (dbaeumer) merged 8 commits into
microsoft:mainfrom
JohannesStoehr:fix/preserve-additional-formatting-options

Conversation

@JohannesStoehr

Copy link
Copy Markdown
Contributor

The LSP-Specification for Formatting specifies that the client can provide custom options but VSCode currently ignores them.
The types vscode.FormattingOptions and vscode-languageserver-protocol.FormattingOptions already provide the option for custom settings, but the helper Function asFormattingOptions ignores them.

This PR changes asFormattingOptions to use all provided options. Since the options can only be a boolean, number or string a shallow copy is enough.
The test case is kept similar to the File Operations suite, where parameters to the server are already verified in tests.

Copilot AI balanced review requested due to automatic review settings October 28, 2026 15:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@JohannesStoehr

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree company="Iconparc"

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are reported for the change preserving additional formatting options in LSP requests.

No open issues 🎉

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues block the change to preserve standard and custom formatting options in LSP requests.

No open issues 🎉

Review effort: Balanced

@dbaeumer

Copy link
Copy Markdown
Member

Johannes Stöhr (@JohannesStoehr) the CI pipeline fails:

@dbaeumer

Dirk Bäumer (dbaeumer) commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Johannes Stöhr (@JohannesStoehr) the CI pipeline fails:

 Document Formatting passes through additional formatting options:
     Error: Received parameters by name but param is not an object literal.
  	at computeSingleParam (node_modules/vscode-languageclient/node_modules/vscode-languageserver-protocol/node_modules/vscode-jsonrpc/lib/common/connection.js:922:27)
  	at computeMessageParams (node_modules/vscode-languageclient/node_modules/vscode-languageserver-protocol/node_modules/vscode-jsonrpc/lib/common/connection.js:939:26)
  	at Object.sendRequest (node_modules/vscode-languageclient/node_modules/vscode-languageserver-protocol/node_modules/vscode-jsonrpc/lib/common/connection.js:1101:33)
  	at LanguageClient.sendRequest (node_modules/vscode-languageclient/lib/common/client.js:630:31)
  	at async Context.<anonymous> (lib/integration.test.js:808:25)

Copilot AI balanced review requested due to automatic review settings October 30, 2026 15:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@JohannesStoehr

Copy link
Copy Markdown
Contributor Author

Dirk Bäumer (@dbaeumer) Sorry, that I missed that. I fixed the test.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are reported for the change preserving custom formatting options.

No open issues 🎉

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 3, 2026 16:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

Copilot AI balanced review requested due to automatic review settings November 4, 2026 06:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues were identified for the change preserving custom formatting options in language-server requests.

No open issues 🎉

Review effort: Balanced

@dbaeumer
Dirk Bäumer (dbaeumer) merged commit 809c31a into microsoft:main Nov 4, 2026
5 checks passed
@dbaeumer Dirk Bäumer (dbaeumer) added this to the 3.18.6 milestone Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants